package com.yida.gwj.expend.outside.service.impl;

import cn.hutool.core.util.ObjectUtil;
import com.yida.gwj.common.domain.GwjBaseBuild;
import com.yida.gwj.expend.outside.domain.GwjMaintenanceFundsBusinessBuild;
import com.yida.gwj.expend.outside.enums.FlagStatusEnum;
import com.yida.gwj.expend.outside.mapper.GwjMaintenanceFundsBusinessBuildMapper;
import com.yida.gwj.expend.outside.service.IGwjMaintenanceFundsBusinessBuildService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 业务楼栋Service业务层处理
 *
 * @author lgp
 * @date 2023-02-20
 */
@Service
public class GwjMaintenanceFundsBusinessBuildServiceImpl implements IGwjMaintenanceFundsBusinessBuildService {
    @Autowired
    private GwjMaintenanceFundsBusinessBuildMapper gwjMaintenanceFundsBusinessBuildMapper;

    /**
     * 查询业务楼栋
     *
     * @param businessBuildId 业务楼栋主键
     * @return 业务楼栋
     */
    @Override
    public GwjMaintenanceFundsBusinessBuild selectGwjMaintenanceFundsBusinessBuildByBusinessBuildId(Long businessBuildId) {
        return gwjMaintenanceFundsBusinessBuildMapper.selectGwjMaintenanceFundsBusinessBuildByBusinessBuildId(businessBuildId);
    }

    /**
     * 查询业务楼栋列表
     *
     * @param gwjMaintenanceFundsBusinessBuild 业务楼栋
     * @return 业务楼栋
     */
    @Override
    public List<GwjMaintenanceFundsBusinessBuild> selectGwjMaintenanceFundsBusinessBuildList(GwjMaintenanceFundsBusinessBuild gwjMaintenanceFundsBusinessBuild) {
        return gwjMaintenanceFundsBusinessBuildMapper.selectGwjMaintenanceFundsBusinessBuildList(gwjMaintenanceFundsBusinessBuild);
    }

    /**
     * 新增业务楼栋
     *
     * @param gwjMaintenanceFundsBusinessBuild 业务楼栋
     * @return 结果
     */
    @Override
    public GwjMaintenanceFundsBusinessBuild insertGwjMaintenanceFundsBusinessBuild(GwjMaintenanceFundsBusinessBuild gwjMaintenanceFundsBusinessBuild) {
        if (ObjectUtil.notEqual(gwjMaintenanceFundsBusinessBuildMapper.insertGwjMaintenanceFundsBusinessBuild(gwjMaintenanceFundsBusinessBuild), FlagStatusEnum.SUC.getCode())) {
            return null;
        }
        return gwjMaintenanceFundsBusinessBuild;
    }

    /**
     * 修改业务楼栋
     *
     * @param gwjMaintenanceFundsBusinessBuild 业务楼栋
     * @return 结果
     */
    @Override
    public int updateGwjMaintenanceFundsBusinessBuild(GwjMaintenanceFundsBusinessBuild gwjMaintenanceFundsBusinessBuild) {
        return gwjMaintenanceFundsBusinessBuildMapper.updateGwjMaintenanceFundsBusinessBuild(gwjMaintenanceFundsBusinessBuild);
    }

    /**
     * 批量删除业务楼栋
     *
     * @param businessBuildIds 需要删除的业务楼栋主键
     * @return 结果
     */
    @Override
    public int deleteGwjMaintenanceFundsBusinessBuildByBusinessBuildIds(Long[] businessBuildIds) {
        return gwjMaintenanceFundsBusinessBuildMapper.deleteGwjMaintenanceFundsBusinessBuildByBusinessBuildIds(businessBuildIds);
    }

    /**
     * 删除业务楼栋信息
     *
     * @param businessBuildId 业务楼栋主键
     * @return 结果
     */
    @Override
    public int deleteGwjMaintenanceFundsBusinessBuildByBusinessBuildId(Long businessBuildId) {
        return gwjMaintenanceFundsBusinessBuildMapper.deleteGwjMaintenanceFundsBusinessBuildByBusinessBuildId(businessBuildId);
    }

    /**
     * 删除业务楼栋信息
     *
     * @param bizId 业务楼栋主键
     * @return 结果
     */
    @Override
    public int deleteGwjMaintenanceFundsBusinessBuildByBusinessId(Long bizId) {
        return gwjMaintenanceFundsBusinessBuildMapper.deleteGwjMaintenanceFundsBusinessBuildByBusinessId(bizId);
    }

    @Override
    public List<GwjMaintenanceFundsBusinessBuild> selectGwjMaintenanceFundsBusinessBuildByBusinessId(Long bizId) {
        return gwjMaintenanceFundsBusinessBuildMapper.selectGwjMaintenanceFundsBusinessBuildByBusinessId(bizId);
    }

    /**
     * 批量新增业务楼栋
     *
     * @param gwjMaintenanceFundsBusinessBuilds 业务楼栋集合
     * @return 结果
     */
    @Override
    public int insertBatchGwjMaintenanceFundsBusinessBuild(List<GwjMaintenanceFundsBusinessBuild> gwjMaintenanceFundsBusinessBuilds) {
        return gwjMaintenanceFundsBusinessBuildMapper.insertGwjMaintenanceFundsBusinessBuildList(gwjMaintenanceFundsBusinessBuilds);
    }

    /**
     * 删除业务楼栋信息
     *
     * @param bizIds 需要删除的数据的业务id
     * @return 结果
     */
    @Override
    public int deleteGwjMaintenanceFundsBusinessBuildByBusinessIds(Long[] bizIds) {
        return gwjMaintenanceFundsBusinessBuildMapper.deleteGwjMaintenanceFundsBusinessBuildByBusinessIds(bizIds);
    }

}
